﻿CREATE PROCEDURE [TipsLikes_update]
	@P_1 Int,
	@P_2 Int,
	@P_3 Int,
	@P_4 Bit,
	@P_5 DateTime,
	@sync_force_write Int,
	@sync_min_timestamp BigInt,
	@sync_row_count Int OUTPUT
AS
BEGIN
SET @sync_row_count = 0; UPDATE [TipsLikes] SET [TipID] = @P_2, [UserID] = @P_3, [Liked] = @P_4, [DateTimeStamp] = @P_5 FROM [TipsLikes] [base] JOIN [TipsLikes_tracking] [side] ON [base].[TipLikeID] = [side].[TipLikeID] WHERE ([side].[local_update_peer_timestamp] <= @sync_min_timestamp OR @sync_force_write = 1) AND ([base].[TipLikeID] = @P_1); SET @sync_row_count = @@ROWCOUNT;
END